package com.hori3d.rc.adapter;

import java.util.List;

import com.hori3d.rc.R;
import com.hori3d.rc.R.drawable;
import com.hori3d.rc.R.id;
import com.hori3d.rc.bean.PrintingRecord;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

	public class PrintingRecordAdapter extends BaseListAdapter<PrintingRecord> {

	  public PrintingRecordAdapter(Context ctx) {
			super(ctx);
			// TODO Auto-generated constructor stub
		}

	Context mContext;

	  public PrintingRecordAdapter(Context ctx, List<PrintingRecord> datas) {
		    super(ctx, datas);
	  }

	 @Override
	public View getView(int position, View conView, ViewGroup parent) {
		 TextView nameView = null;   
		 TextView dateView = null;   
		 TextView timeUsedView = null;   
		 PrintingRecord printingrecord=datas.get(position);
		  if (conView == null) {
		      //conView = View.inflate(ctx, R.layout.group_item,null);
		      conView = inflater.inflate(R.layout.item_printing_record, null, false);
		      
			   nameView = ViewHolder.findViewById(conView, R.id.tv_file_name_print_record_item);
			   dateView = ViewHolder.findViewById(conView, R.id.tv_time_start_print_record_item);
			   timeUsedView = ViewHolder.findViewById(conView, R.id.tv_time_used_print_record_item);
	   
		    }

		    nameView.setText(printingrecord.getFile().getAbsolutePath());
		    timeUsedView.setText(printingrecord.getTimeUsed());
		    dateView.setText(printingrecord.getDate());
		    return conView;
		  }
	};